import $http from '../utils/request.js'

// 地址列表
export function getAddressList(query) {
	return $http.httpRequest({
		url: '/users/address/lists',
		data:query
	})
}

// 编辑地址
export function editAddress(query, url) {
	return $http.httpRequest({
		url: url,
		methods:'POST',
		headers: 'application/json',
		data:query
	})
}

// 地址信息
export function getAddressDetail(query) {
	return $http.httpRequest({
		url: '/users/address/' + query.addressId
	})
}

// 设置默认地址
export function setDefaultAddress(query) {
	return $http.httpRequest({
		url: '/users/address/default/' + query.addressId,
		methods:'POST',
		data:query
	})
}

// 删除地址
export function delAddress(query) {
	return $http.httpRequest({
		url: '/users/address/delete/' + query.addressId,
		methods:'POST'
	})
}

// 获取默认地址
export function getDefaultAddress() {
	return $http.httpRequest({
		url: '/users/address/getdefault'
	})
}